<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学习</title>
</head>
<style>

    .a{
        width: 500px;
        height: 500px;
        background-color: aqua;
        position: relative;
    }
    /* 绝对居中 */
    img {
        position: absolute;
        width: 200px;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        transition: all 2s;
    }

    img:hover {
        width: 500px;
    }

    

</style>
<body>

    <!-- <div class="a"> -->
        <img src="./images/1.png" alt="">
    <!-- </div> -->

    
</body>
</html>